//获取应用实例
const app = getApp()
Page({
  data: {
    slider: [],
    swiperCurrent: 0,
    current: 0, // swiper初始对应的swiper-item
    interval: 5000, autoplay: true, isActive: false, isActives: false, typeNameStr: 0, isReport: false, isXTSP: false, isCZRZ: false, isPingFen: false, isXTZZ: false, isWorkReport:false,
    isXTSPSW:false,
    organName: '', isGzh:''
  },
  onLoad: function(options) {
    //轮播图
    var that = this;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/cshUserOpenid.action',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        openid: wx.getStorageSync("userOpenid"),
      },
      success: function(res) {
        if (res.data.status == "success") {
          wx.request({
            url: 'https://wxapp.shuhai.cc/hh/findResult.action',
            method: 'post',
            header: {
              'content-type': 'application/x-www-form-urlencoded'
            },
            data: {
              openid: wx.getStorageSync("userOpenid"),
            },
            success: function(res) {
              wx.setStorageSync("shuhai_party_id", res.data.data.shuhai_party_id);
              wx.setStorageSync("shuhai_jtid", res.data.data.shuhai_jtid) 
              wx.setStorageSync("name", res.data.data.shuhai_userName);
              if (res.data.data.shuhai_userName == "李飞 " || res.data.data.shuhai_userName == "刘立平" || res.data.data.shuhai_userName == " 潘峰" || res.data.data.shuhai_userName == "薛海斌" || res.data.data.shuhai_userName == "王永江" || res.data.data.shuhai_userName == "赵玉" || res.data.data.shuhai_userName == "白宁") {
                that.setData({
                  isXTSPSW: true
                })
              }



              if (res.data.data.shuhai_userName == "贾新田" || res.data.data.shuhai_userName == "胡彦威" || res.data.data.shuhai_userName == "荆作栋" ) {
                that.setData({
                  isXTZZ: true
                })   
              }
              if (res.data.data.shuhai_userName == "范舒阳" || res.data.data.shuhai_userName == "张帆"){
                that.setData({
                  isCZRZ: true,
                  isXTZZ: true,
                  isWorkReport: true,
                  isXTSPSW: true
                })
              }
              if (res.data.data.shuhai_userName == "范舒阳" || res.data.data.shuhai_userName == "郭文礼" || res.data.data.shuhai_userName == "荆作栋" ||  res.data.data.shuhai_userName == "张帆"){
                that.setData({
                  isXTSP: true               
                })
              }
              if (res.data.data.shuhai_userName == "范舒阳" || res.data.data.shuhai_userName == "张帆" || res.data.data.shuhai_userName == "胡彦威") {
                that.setData({
                  isPingFen: true
                })
              }
              //判断ASDF 是否隐藏
              if (res.data.data.shuhai_userName == "张帆" || res.data.data.shuhai_userName == "范舒阳" || res.data.data.shuhai_userName == "胡彦威") {
                that.setData({
                  isActive: true,
                  isActives: true
                })
              }  
              //判断集团登陆 ‘调研报告’ 是否显示
              if (res.data.data.shuhai_userName == "贾新田" || res.data.data.shuhai_userName == "胡彦威" || res.data.data.shuhai_userName == "李文芳" || res.data.data.shuhai_userName == "荆作栋" || res.data.data.shuhai_userName == "吕建新" || res.data.data.shuhai_userName == "赵东军" || res.data.data.shuhai_userName == "雷俊林"||res.data.data.shuhai_userName == "李飞" || res.data.data.shuhai_userName == "康宏" || res.data.data.shuhai_userName == "杨兆刚" || res.data.data.shuhai_userName == "崔建聪" || res.data.data.shuhai_userName == "路建宏" || res.data.data.shuhai_userName == "邢海民" || res.data.data.shuhai_userName == "王珂" || res.data.data.shuhai_userName == "唐锋" || res.data.data.shuhai_userName == "郭文礼" || res.data.data.shuhai_userName == "樊有忠" || res.data.data.shuhai_userName == "智明" || res.data.data.shuhai_userName == "范勇" || res.data.data.shuhai_userName == "高红萍" || res.data.data.shuhai_userName == "胡景明" || res.data.data.shuhai_userName == "郭跃军" || res.data.data.shuhai_userName == "裴建平" || res.data.data.shuhai_userName == "赵玉" || res.data.data.shuhai_userName == "范舒阳" || res.data.data.shuhai_userName == "孙志勇" || res.data.data.shuhai_userName == "原琳" || res.data.data.shuhai_userName == "李勇" || res.data.data.shuhai_userName == "张帆") {
                that.setData({
                  isActives: true,
                  isReport: true, 
                  isGzh: true, 
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "姚军") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西人民出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "续小强") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                 // organName: "北岳文艺出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "张宝东") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西经济出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "孟绍勇") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "希望出版社有限公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "刘立平") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西教育出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "赵建伟") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西科学技术出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "张慧君") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西春秋电子音像出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "阎文凯") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西古籍出版社有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "杨明波") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西省印刷物资有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "杨志刚") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西新华印业有限公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "张隆光") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西出版传媒集团有限责任公司教材中心"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "李岩") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西人民印刷有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "王跃东") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西省新闻出版纸张有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "赵学文") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西三晋报刊传媒集团有限责任公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "杨棣华") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                 // organName: "山西省美术印刷厂"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "刘兴太") {
                that.setData({
                  isActives: true,
                  isReport: true, isGzh: true,
                  //organName: "山西新华书店集团有限公司"
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "李洋") {
                that.setData({
                  isActives: true ,
                  isGzh:true,
                  organName: '山西出版传媒集团有限责任公司'                
                })
              }
              if (res.data.data.shuhai_userName == "李晨" ||res.data.data.shuhai_userName == "马庆云"){
                that.setData({
                  isGzh: true, 
                  //organName: '山西人民出版社有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "刘立平"||res.data.data.shuhai_userName == "马宏") {
                that.setData({
                  isGzh: true,
                  //organName: '山西教育出版社有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "刘志屏") {
                that.setData({
                  isGzh: true,
                  //organName: '希望出版社有限公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "谢一兵" || res.data.data.shuhai_userName == "薄九深") {
                that.setData({
                  isGzh: true,
                  //organName: '山西科学技术出版社有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "董利斌" || res.data.data.shuhai_userName == "熊汉宗") {
                that.setData({
                  isGzh: true,
                  //organName: '山西经济出版社有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "赵瑞" || res.data.data.shuhai_userName == "刘思华") {
                that.setData({
                  isGzh: true,
                  //organName: '北岳文艺出版社有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "莫晓东" || res.data.data.shuhai_userName == "翟晓宾") {
                that.setData({
                  isGzh: true,
                  //organName: '山西三晋报刊传媒集团有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "王忠泽" || res.data.data.shuhai_userName == "张晓华") {
                that.setData({
                  isGzh: true,
                  //organName: '山西春秋电子音像出版社有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "高宇") {
                that.setData({
                  isGzh: true,
                  //organName: '山西三晋报刊传媒集团有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "赵文彦" || res.data.data.shuhai_userName == "路正刚") {
                that.setData({
                  isGzh: true,
                  //organName: '山西出版传媒集团有限责任公司教材中心'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "吴罡" || res.data.data.shuhai_userName == "刘强") {
                that.setData({
                  isGzh: true,
                  //organName: '山西省新闻出版纸张有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "郝世英" || res.data.data.shuhai_userName == "李秀坤") {
                that.setData({
                  isGzh: true,
                  //organName: '山西省印刷物资有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "杨宁" || res.data.data.shuhai_userName == "陈海宏") {
                that.setData({
                  isGzh: true,
                  //organName: '山西新华印业有限公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "李文新") {
                that.setData({
                  isGzh: true,
                  //organName: '山西省美术印刷厂'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "沈士强" || res.data.data.shuhai_userName == "任玉红") {
                that.setData({
                  isGzh: true,
                  //organName: '山西人民印刷有限责任公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              } else if (res.data.data.shuhai_userName == "李海燕" || res.data.data.shuhai_userName == "牛冬丽") {
                that.setData({
                  isGzh: true,
                  //organName: '山西新华书店集团有限公司'
                  organName: '山西出版传媒集团有限责任公司'
                })
              }
              wx.switchTab({
                url: '../index/index'
              })
            },
          });
        } else {
          wx.redirectTo({
            url: '../login/login'
          })
        }
      }
    })
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/gainLunbotuList.action',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        that.setData({
          slider: res.data.data
        })
      },
    })
    // 初始化最新资讯
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/new_messageList.action',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        that.setData({
          news: res.data.data
        })
      },
    })
  },
  // 点击轮播图
  bannerDetail: function(e) {
    var that = this;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '7',
        userid: wx.getStorageSync("userOpenid"),
        lbtid: e.currentTarget.dataset.id
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../bannerDetail/bannerDetail?id=' + e.currentTarget.dataset.id,
        })
      }
    });
  },
  aa: function(e) {
    this.setData({
      swiperCurrent: e.detail.current
    })
  },
 //跳转问题反馈
  goFeedback:function(){
    wx.navigateTo({
      url: '/pages/sh_feedback/sh_feedback',
    })
  },
  //跳转工资查询
  goSalary: function() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '3',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了工资查询模块'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../salary/salary?id=' + 122,
        })
      }
    });
  },
  goMore: function() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '10',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了最新资讯查看更多模块'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../zx/zx',
        })
      }
    });
  },
  // 跳转资讯详情
  goID: function(e) {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '6',
        userid: wx.getStorageSync("userOpenid")
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../zx_id/zx_id?id=' + e.currentTarget.dataset.id,
        })
      }
    });
  },
  goTongxun: function() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '2',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了通讯录模块'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../Navigetor/navigetor',
        })
      }
    });
  },
  goNew: function() {
    //埋点新闻
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '1',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了新闻模块'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../sh_new/sh_new',
        })
      },
    })
  },
  goFawen: function() {
    wx.navigateTo({
      url: '../fawenlist/fawenlist',
    })
  },
  //操作日志
  goLog: function () {
    wx.navigateTo({
      url: '../sh_tz_czrz/sh_tz_czrz',
    })
  },
  //人民社评分
  goPingFen:function(){
    var that = this;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '18',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了人民社评分'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        wx.request({
          url: 'https://wxapp.shuhai.cc/hh/findPhoneNum.action',
          method: 'post',
          header: {
            'content-type': 'application/x-www-form-urlencoded'
          },
          data: {
            openid: wx.getStorageSync("userOpenid"),
          },
          success: function (res) {
            wx.navigateTo({
              url: '../sh_tz_rypf/sh_tz_rypf',
            })           
          },
          fail: function (res) {
            wx.hideLoading();
            wx.showToast({
              title: '网络错误！',
              icon: 'none',
              duration: 2000
            })
            return;
          }
        })
      }
    })
  },
  //选题追踪
  goTopicsTracking: function () {
    var that = this;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',

      
      data: {
        type: '19',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了选题追踪'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        console.log(""+wx.getStorageSync("userOpenid"))
        wx.request({
          url: 'https://wxapp.shuhai.cc/hh/findPhoneNum.action',
          method: 'post',
          header: {
            'content-type': 'application/x-www-form-urlencoded'
          },
          data: {
            openid: wx.getStorageSync("userOpenid"),
          },
          success: function (res) {
            wx.showToast({
              title: '正在登入系统',
              icon: 'loading',
              duration: 6000
            })
            if (res.data.status == "success") {
              var phone = res.data.data.result;
              //如果是一条数据直接跳转，如果是两条数据展示
              wx.request({
                url: 'https://wxapp.shuhai.cc/hh/goTopicsTracking.action',
                method: 'post',
                header: {
                  'content-type': 'application/x-www-form-urlencoded'
                },
                data: {
                  phone: phone,
                },
                success: function (res) {
                  if (res.data.status == "success_one") {
                    var result = phone;
                    wx.navigateTo({
                      url: '../sh_tz_xtzz/sh_tz_xtzz?phone=' + result,
                    })
                  } else if (res.data.status == "authorization") {
                    wx.hideLoading();
                    wx.showToast({
                      title: '暂时还未为您开通该权限',
                      icon: 'none',
                      duration: 8000
                    })
                  } else if (res.data.status == "success") {
                    var result = phone;
                    wx.navigateTo({
                      url: '../sh_button_xtzz/sh_button_xtzz?phone=' + result,
                    })
                  } else {
                    wx.hideLoading();
                    wx.showToast({
                      title: '获取所属账号失败！',
                      icon: 'none',
                      duration: 2000
                    })
                    return;
                  }
                },
                fail: function (res) {
                  wx.hideLoading();
                  wx.showToast({
                    title: '网络错误！',
                    icon: 'none',
                    duration: 2000
                  })
                  return;
                }
              });
            } else {
              wx.hideLoading();
              wx.showToast({
                title: '手机号不存在',
                icon: 'none',
                duration: 5000
              })
            }
          },
          fail: function (res) {
            wx.hideLoading();
            wx.showToast({
              title: '网络错误！',
              icon: 'none',
              duration: 2000
            })
            return;
          }
        })
      }

    })
  },
  //教育出版社选题审批
  goTopicsPublishing: function () {
    var that = this;
    console.log("教育出版社选题审批")
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '21',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了教育出版社选题审批'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        wx.request({
          url: 'https://wxapp.shuhai.cc/hh/findPhoneNum.action',
          method: 'post',
          header: {
            'content-type': 'application/x-www-form-urlencoded'
          },
          data: {
            openid: wx.getStorageSync("userOpenid"),
          },
          success: function (res) {
            wx.showToast({
              title: '正在登入系统',
              icon: 'loading',
              duration: 6000
            })
            if (res.data.status == "success") {
              var phone = res.data.data.result;
              //如果是一条数据直接跳转，如果是两条数据展示
              wx.request({
                url: 'https://wxapp.shuhai.cc/hh/goTopicsPublishing.action',
                method: 'post',
                header: {
                  'content-type': 'application/x-www-form-urlencoded'
                },
                data: {
                  phone: phone,
                },
                success: function (res) {
                  if (res.data.status == "success_one") {
                    var result = phone;
                    console.log("教育出版社选题审批====" + res.data.status)
                    wx.navigateTo({
                      url: '../sh_tz_xtsps/sh_tz_xtsps?phone=' + result,
                    })
                  } else if (res.data.status == "authorization") {
                    wx.hideLoading();
                    wx.showToast({
                      title: '暂时还未为您开通该权限',
                      icon: 'none',
                      duration: 8000
                    })
                  } else if (res.data.status == "success") {
                    var result = phone;
                    wx.navigateTo({
                      url: '../sh_button_xtsp/sh_button_xtsp?phone=' + result,
                    })
                  } else {
                    wx.hideLoading();
                    wx.showToast({
                      title: '获取所属账号失败！',
                      icon: 'none',
                      duration: 2000
                    })
                    return;
                  }
                },
                fail: function (res) {
                  wx.hideLoading();
                  wx.showToast({
                    title: '网络错误！',
                    icon: 'none',
                    duration: 2000
                  })
                  return;
                }
              });
            } else {
              wx.hideLoading();
              wx.showToast({
                title: '手机号不存在',
                icon: 'none',
                duration: 5000
              })
            }
          },
          fail: function (res) {
            wx.hideLoading();
            wx.showToast({
              title: '网络错误！',
              icon: 'none',
              duration: 2000
            })
            return;
          }
        })
      }

    })
  },
  //集团选题审批
  goTopics:function(){
    var that = this;

    console.log("集团选题审批")
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '17',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了集团选题审批'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success:function(res){
        wx.request({
          url: 'https://wxapp.shuhai.cc/hh/findPhoneNum.action',
          method: 'post',
          header: {
            'content-type': 'application/x-www-form-urlencoded'
          },
          data: {
            openid: wx.getStorageSync("userOpenid"),
          },
          success: function (res) {
            wx.showToast({
              title: '正在登入系统',
              icon: 'loading',
              duration: 6000
            })
            if (res.data.status == "success") {
              var phone = res.data.data.result;
              //如果是一条数据直接跳转，如果是两条数据展示
              wx.request({
                url: 'https://wxapp.shuhai.cc/hh/goTopics.action',
                method: 'post',
                header: {
                  'content-type': 'application/x-www-form-urlencoded'
                },
                data: {
                  phone: phone,
                },
                success: function (res) {
                  if (res.data.status == "success_one") {
                    var result = phone;
                    console.log("集团选题审批" + res.data.status)
                    wx.navigateTo({
                      url: '../sh_tz_xtsp/sh_tz_xtsp?phone=' + result,
                    })
                  } else if (res.data.status == "authorization") {
                    wx.hideLoading();
                    wx.showToast({
                      title: '暂时还未为您开通该权限',
                      icon: 'none',
                      duration: 8000
                    })
                  } else if (res.data.status == "success") {
                    var result = phone;
                    wx.navigateTo({
                      url: '../sh_button_xtsp/sh_button_xtsp?phone=' + result,
                    })
                  } else {
                    wx.hideLoading();
                    wx.showToast({
                      title: '获取所属账号失败！',
                      icon: 'none',
                      duration: 2000
                    })
                    return;
                  }
                },
                fail: function (res) {
                  wx.hideLoading();
                  wx.showToast({
                    title: '网络错误！',
                    icon: 'none',
                    duration: 2000
                  })
                  return;
                }
              });
            } else {
              wx.hideLoading();
              wx.showToast({
                title: '手机号不存在',
                icon: 'none',
                duration: 5000
              })
            }
          },
          fail: function (res) {
            wx.hideLoading();
            wx.showToast({
              title: '网络错误！',
              icon: 'none',
              duration: 2000
            })
            return;
          }
        })
      }

    })
  },
  //发行数据
  goBI: function() {
    var that = this;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',   
      method: 'post',
      data: {
        type: '4',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了发行数据模块'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.request({
          url: 'https://wxapp.shuhai.cc/hh/findPhoneNum.action',
          method: 'post',
          header: {
            'content-type': 'application/x-www-form-urlencoded'
          },
          data: {
            openid: wx.getStorageSync("userOpenid"),
          },

       
          success: function(res) {
            wx.showToast({
              title: '正在登入系统',
              icon: 'loading',
              duration: 6000
            })
            if (res.data.status == "success") {
              var phone = res.data.data.result;
              //如果是一条数据直接跳转，如果是两条数据展示
              wx.request({
                url: 'https://wxapp.shuhai.cc/hh/showAccount.action',
                method: 'post',
                header: {
                  'content-type': 'application/x-www-form-urlencoded'
                },
                data: {
                  phone: phone,
                },
                success: function(res) {
                  if (res.data.status == "success_one") {
                    var result = phone;
                    wx.navigateTo({
                      url: '../sh_tz/sh_tz?phone=' + result,
                    })
                  } else if (res.data.status == "authorization") {
                    wx.hideLoading();
                    wx.showToast({
                      title: '暂时还未为您开通该权限',
                      icon: 'none',
                      duration: 8000
                    })
                  } else if (res.data.status == "success") {
                    var result = phone;
                    wx.navigateTo({
                      url: '../sh_button/sh_button?phone=' + result,
                    })
                  } else {
                    wx.hideLoading();
                    wx.showToast({
                      title: '获取所属账号失败！',
                      icon: 'none',
                      duration: 2000
                    })
                    return;
                  }
                },
                fail: function(res) {
                  wx.hideLoading();
                  wx.showToast({
                    title: '网络错误！',
                    icon: 'none',
                    duration: 2000
                  })
                  return;
                }
              });
            } else {
              wx.hideLoading();
              wx.showToast({
                title: '手机号不存在',
                icon: 'none',
                duration: 5000
              })
            }
          },
          fail: function(res) {
            wx.hideLoading();
            wx.showToast({
              title: '网络错误！',
              icon: 'none',
              duration: 2000
            })
            return;
          }
        })
      },
    })
  },
  goAPP: function() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '5',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了APP下载模块'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../sh_applv/sh_applv',
        })
      },
    })
  },
  // 下拉刷新
  onPullDownRefresh: function() {
    var that = this;
    wx.setNavigationBarTitle({
      title: '出版传媒'
    });
    wx.showNavigationBarLoading(); //在标题栏中显示加载图标
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/gainLunbotuList.action',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        that.setData({
          slider: res.data.data
        })
      }
    })
    // 初始化最新资讯
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/new_messageList.action',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        if (res.data.status == "success") {
          that.setData({
            news: res.data.data
          })
        }
      },
      complete: function() {
        wx.hideNavigationBarLoading(); //完成停止加载
        wx.stopPullDownRefresh(); //停止下拉刷新
      }
    })
  },
  //信息化周报
  goAPPyue: function() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '13',
        userid: wx.getStorageSync("userOpenid"),
        content: '信息化周报'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../Yuebao/Yuebao'
        })
      },
    })
  },
  //调研报告
  goReport: function() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '14',
        userid: wx.getStorageSync("userOpenid"),
        content: '调研报告'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        wx.navigateTo({
          url: '../sh_tz_de/sh_tz_de',
        })
      },
    })
    
  },
  //公众号统计
  goTotal: function(e) {
    var organNameNew =this.data.organName;
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '15',
        userid: wx.getStorageSync("userOpenid"),
        content: '公众号统计'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        wx.navigateTo({
          url: '../TJpage/index/index?organName=' + organNameNew,
        })
      },
    }) 
  },
  //点击跳转页面
  goAsdf() {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '12',
        userid: wx.getStorageSync("userOpenid"),
        content: '电子物品'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function(res) {
        wx.navigateTo({
          url: '../text/text',
        })
      },
    })
  },
  //整改意见
  reming: function () {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '16',
        userid: wx.getStorageSync("userOpenid"),
        content: '整改意见'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        wx.navigateTo({
          url: '../sh_tz_idea/sh_tz_idea',
        })
      },
    })  
  },
  //AI助手
  goWorkReport: function () {
    wx.request({
      url: 'https://wxapp.shuhai.cc/hh/clickLog.action',
      method: 'post',
      data: {
        type: '20',
        userid: wx.getStorageSync("userOpenid"),
        content: '点击了AI助手'
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        wx.navigateTo({
          url: '../sh_tz_gzhb/sh_tz_gzhb',
        })
      },
    })    
  },
})